//添加等待房间
import {AxiosDeleteToParams, AxiosPostToJson} from "./AxiosEncapsulation.js";

async function AddWaitingRoom(jsonData) {
    const response = await AxiosPostToJson('/api/chess-rooms/rooms', jsonData)
    return await response;
}

// 玩家 加入等待房间
async function JoinWaitingRoom(jsonData) {
    const response = await AxiosPostToJson('/api/chess-rooms/members', jsonData)
    return await response;
}
// 离开等候室
async function LeaveWaitingRoom() {
    const response = await AxiosDeleteToParams('/api/chess-rooms/members')
    return await response;
}
// 删除等待房间
async function DeleteWaitingRoom(jsonData) {
    const response = await AxiosDeleteToParams('/api/chess-rooms/rooms', jsonData)
    return await response;
}

export {AddWaitingRoom, DeleteWaitingRoom,LeaveWaitingRoom, JoinWaitingRoom}
